<!--
 * @Author: cgl
 * @Date: 2023-06-19 10:06:51
 * @LastEditors: cgl
 * @LastEditTime: 2023-08-08 22:54:41
 * @FilePath: \public-health-emergencies-fed:\radiation-hygiene-fe\src\views\slide\components\testItem\testItem06.vue
 * @Description: 06-DR专用检测项
 *
 * Copyright (c) 2023 by cgl/微盛信息产业有限公司, All Rights Reserved.
-->
<template>
  <div class="content" style="position: relative;">
		<!-- <div class="tip-30 forminput">
			焦点至影像探测器距离（SID）为：
			<el-radio-group v-model="form.sidType" class="split-radio" style="transform: translateY(-2px)" @change="changetube($event, '2-1')">
				<el-radio :label="0">180cm</el-radio> <span class="split">/</span>
				<el-radio :label="1">SID 最大值<el-input :disabled="form.sidType == 0" v-model="form.cus_formsid" class="input-line"/> cm；</el-radio>
			</el-radio-group>
			SDD = <el-input v-model="form.sdd" class="input-line"/> cm。
		</div> -->

		<el-button
			style="position: absolute; top: 0px; right: 10px;"
			type="primary"
			@click="handleAddTestItem06"
		>增加探测器</el-button>

		<div class="innertitle forminput" v-if="tabList.find(item => item.name.indexOf('06') > -1 && item.name.indexOf(':') > -1)">
			<span v-if="itemIndex == 0">（一）</span>
			<span v-if="itemIndex == 1">（二）</span>
			<span v-if="itemIndex == 2">（三）</span>
			<span v-if="itemIndex == 3">（四）</span>
			<span v-if="itemIndex == 4">（五）</span>
			{{ Number(itemIndex) + 1 }}号DR板（位置：<el-input v-model="form.positionName" data-cusValidate="text" style="width: 300px;"/>）
		</div>

		<div class="tip-30 forminput">
			统一检测条件：SID = <el-input v-model="form.sid" class="input-line"/> cm。
			（ <el-checkbox v-model="form.notHave" :true-label="1" :false-label="0" style="margin-right: 0">影像增强器数字摄影检测无此项</el-checkbox>）
		</div>

		<!-- 1.探测器剂量指示（DDI）------------------------------------------------------------------------ -->
		<div id="table1">
			<div class="innertitle">
				1.探测器剂量指示（DDI）:
				<!-- （ <el-checkbox @change="changeNotHave($event, 1)" v-model="form1.notHave" style="margin-right: 0">该机生产厂家未提供DDI计算公式</el-checkbox>） -->
				（ <el-checkbox
					style="margin-right: 0"
					v-model="form1.notObtain"
				>无法获取预处理影像</el-checkbox>）
			</div>

			<div class="tip-30">
				<span>预置条件：<el-input v-model="form1.tubeVoltage" class="input-line"/>kV/<el-input v-model="form1.tubeCurrent" class="input-line"/>mAs</span>
				滤线栅：
				<el-radio-group v-model="form1.takeOutFilterGrid" class="split-radio">
					<el-radio :label="1">取下</el-radio>
					<el-radio :label="2">无法取下</el-radio>
					<el-radio :label="0">无</el-radio>
				</el-radio-group>;
				<span>附加滤过:1mmCu;</span>
				<el-checkbox style="margin-left: 8px;" v-model="form1.baseLineDefinition" :disabled="!form1.baseLineControls">建立基线值;</el-checkbox>
        <span v-show="form1.baseLineDefinition">
          建立原因:<el-input class="input-line" style="width: 200px !important;" v-model="form1.baseLineReason" data-cusValidate="text" />
        </span>
				校准因子：<el-input v-model="form1.calibrationFactorValue" class="input-line result" disabled/>
			</div>

			<table border="1" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td rowspan="4">剂量指示</td>
					<td rowspan="2" width="200px">
						<el-checkbox @change="changeNotHave($event, 1)" v-model="form1.ddi" style="margin-right: 0">DDI</el-checkbox>
            <!-- <br/>
						(<el-input v-model="form1.ddiValue" class="input-line" />) -->
					</td>
					<td colspan="12">
						<i>$DDI_测量$</i>
					</td>
					<td width="110px">参考剂量,μGy</td>
					<td>修正值</td>
					<td><i>$DDI_参考$</i></td>
					<td><i>$DDI_基线$</i></td>
					<td><i>$DDI_偏差$</i>，%</td>
				</tr>

				<tr>
					<td colspan="3"><el-input v-model="form1.ddiValue_1"/></td>
					<td colspan="3"><el-input v-model="form1.ddiValue_2"/></td>
					<td colspan="3"><el-input v-model="form1.ddiValue_3"/></td>
					<td colspan="3" width="10%" class="result">Avg：{{ form1.ddiValueAvg }}</td>
					<td><el-input v-model="form1.referenceDose"/></td>
					<td class="result"><el-input v-model="form1.calibrationValue" disabled/></td>
					<td><el-input v-model="form1.referenceDDI"/></td>
					<td :class="{result: !form1.baseLineControls}" width="8%" @click="handleDbClickBaselineDDI(form1.baselineDDI)">
						<span class="text-underline" v-show="!form1.baseLineControls">{{ form1.baselineDDI }}</span>
						<el-input v-model="form1.baselineDDI" v-show="form1.baseLineControls"/>
					</td>
					<td class="result">{{ form1.deviationDDI }}</td>
				</tr>

				<tr>
					<td rowspan="2" width="200px">
						<el-checkbox v-model="form1.pixel" style="margin-right: 0">平均像素值</el-checkbox><br/>
					</td>
					<td colspan="13">
						实测平均像素值，<i>$PV_测量$</i>
					</td>
					<td colspan="3">
						<i>$PV_基线$</i>
					</td>
					<td><i>$DDI_偏差$</i>，%</td>
				</tr>
				<tr>
					<td colspan="4"><el-input v-model="form1.readoutValue_1"/></td>
					<td colspan="4"><el-input v-model="form1.readoutValue_2"/></td>
					<td colspan="4"><el-input v-model="form1.readoutValue_3"/></td>
					<td class="result">Avg：{{ form1.averageReadoutValue }}</td>
					<td colspan="3" :class="{result: !form1.baseLineControls}" @click="handleDbClickBaselineDDI(form1.baselineValue)">
						<span class="text-underline" v-show="!form1.baseLineControls">{{ form1.baselineValue }}</span>
						<el-input v-model="form1.baselineValue" v-show="form1.baseLineControls"/>
					</td>
					<td class="result">{{ form1.deviation }}</td>
				</tr>
			</table>
			<div class="tip-50">
				DDI：<i>$ DDI_偏差 = \frac{DDI_测量 - DDI_{参考/基线} }{ DDI_{参考/基线} } \times 100% $</i> <br/>
				PV：<i>$ PV_偏差 = \frac{PV_测量 - PV_基线}{ PV_基线 } \times 100% $</i> <br/>
				备注：验收检测时，如生产厂家未提供DDI计算公式则建立DDI基线值，如设备无DDI指示则建立平均像素基线值；状态检测时，如生产厂家未提供DDI计算公式则测量值与设备基线值进行比较。
			</div>
		</div>

		<!-- 2.信号传递特性（STP）------------------------------------------------------------------------ -->
		<div id="table2">
			<div class="innertitle">
				2.信号传递特性（STP）
				（ <el-checkbox
					style="margin-right: 0"
					v-model="form2.notObtain"
				>无法获取预处理影像</el-checkbox>）
			</div>
			<!-- （ <el-checkbox @change="changeNotHave($event, 2)" v-model="form2.notHave" style="margin-right: 0">设备不具备预处理影像程序</el-checkbox>） -->

			<div class="tip-30">
				<span>管电压：<el-input v-model="form2.tubeVoltage" class="input-line"/>kV</span>
				滤线栅：
				<el-radio-group v-model="form2.takeOutFilterGrid" class="split-radio">
					<el-radio :label="1">取下</el-radio>
					<el-radio :label="2">无法取下</el-radio>
					<el-radio :label="0">无</el-radio>
				</el-radio-group>;
				<span>附加滤过:1mmCu</span>;
				拟合类型：<el-radio-group v-model="form2.computeType" class="split-radio">
					<el-radio :label="0">线性拟合</el-radio>
					<el-radio :label="1">对数拟合</el-radio>
					<el-radio :label="2">指数拟合</el-radio>
				</el-radio-group>；
				校准因子：<el-input v-model="form2.calibrationFactorValue" class="input-line result" disabled/>
			</div>

			<table border="1" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td width="120px">预置条件</td>
					<td>约1μGy</td>
					<td>约5μGy</td>
					<td>约10μGy</td>
					<td>约20μGy</td>
					<td>约30μGy</td>
					<td rowspan="3" width="20%">拟合方程<i>$R^2$</i>值</td>
				</tr>
				<tr>
					<td>
						<el-radio-group v-model="form2.tubeCurrenType" class="split-radio">
							<el-radio :label="1">mA</el-radio>
							<el-radio :label="2">ms</el-radio>
						</el-radio-group>
					</td>
					<td>
						<el-input v-model="form2.tubeCurren_1"/>
					</td>
					<td>
						<el-input v-model="form2.tubeCurren_5"/>
					</td>
					<td>
						<el-input v-model="form2.tubeCurren_10"/>
					</td>
					<td>
						<el-input v-model="form2.tubeCurren_20"/>
					</td>
					<td>
						<el-input v-model="form2.tubeCurren_30"/>
					</td>
				</tr>
				<tr>
					<td>预置参数，mAs</td>
					<td>
						<el-input v-model="form2.milliampereSecond_1"/>
					</td>
					<td>
						<el-input v-model="form2.milliampereSecond_5"/>
					</td>
					<td>
						<el-input v-model="form2.milliampereSecond_10"/>
					</td>
					<td>
						<el-input v-model="form2.milliampereSecond_20"/>
					</td>
					<td>
						<el-input v-model="form2.milliampereSecond_30"/>
					</td>
				</tr>
				<tr>
					<td>入射剂量，μGy</td>
					<td>
						<el-input v-model="form2.measurementValue_1"/>
					</td>
					<td>
						<el-input v-model="form2.measurementValue_5"/>
					</td>
					<td>
						<el-input v-model="form2.measurementValue_10"/>
					</td>
					<td>
						<el-input v-model="form2.measurementValue_20"/>
					</td>
					<td>
						<el-input v-model="form2.measurementValue_30"/>
					</td>
					<td rowspan="3" class="result">
						<!-- 线性 -->
						<span v-if="form2.computeType == 0 && form2.linearA && form2.linearB">
							{{ `y = ${form2.linearA} x + ${form2.linearB}` }}
						</span>
						<!-- 对数 -->
						<span v-if="form2.computeType == 1 && form2.linearA && form2.linearB">
							{{ `y = ${form2.linearB} ln(x) + ${form2.linearA}` }}
						</span>
						<!-- 指数 -->
						<span v-if="form2.computeType == 2 && form2.linearA && form2.linearB">
							<!-- <i>$y = {{ form2.linearA }}e^{ {{ form2.linearB }}x }$</i> -->
							<i>y = {{ form2.linearA }}e<sup>{{ form2.linearB }}x</sup></i>
						</span>
						<br />
						<span style="display: inline-block; margin-top: 10px;">
							<i>$R^2$</i> = {{ form2.fittingRelevantParameters }}
						</span>
					</td>
				</tr>
				<tr>
					<td>修正值</td>
					<td class="result">
						<el-input v-model="form2.calibrationValue_1" disabled/>
					</td>
					<td class="result">
						<el-input v-model="form2.calibrationValue_5" disabled/>
					</td>
					<td class="result">
						<el-input v-model="form2.calibrationValue_10" disabled/>
					</td>
					<td class="result">
						<el-input v-model="form2.calibrationValue_20" disabled/>
					</td>
					<td class="result">
						<el-input v-model="form2.calibrationValue_30" disabled/>
					</td>
				</tr>
				<tr>
					<td>平均像素值</td>
					<td>
						<el-input v-model="form2.averagePixelValue_1"/>
					</td>
					<td>
						<el-input v-model="form2.averagePixelValue_5"/>
					</td>
					<td>
						<el-input v-model="form2.averagePixelValue_10"/>
					</td>
					<td>
						<el-input v-model="form2.averagePixelValue_20"/>
					</td>
					<td>
						<el-input v-model="form2.averagePixelValue_30"/>
					</td>
				</tr>
			</table>
			<!-- <div class="tip-50" style="line-height: 30px">
				剂量校准值 = 剂量测量值 × 校准因子；STP公式：
				<div class="result" style="min-width: 150px; height: 20px;line-height: 20px;display: inline-block; vertical-align: middle">{{ `${(form2.linearA && form2.linearB) ? 'y =' + form2.linearA + (form2.linearB < 0 ? '' : '+') +form2.linearB + (form2.computeType == 0 ? 'x' : 'ln(x)') : ''}` }}</div>
				（K为剂量校准值，PV为 ROI 平均像素值）
				<br>剂量校准值均通过距离平方反比修正到影像接收器入射表面
			</div> -->
		</div>

		<!-- 3.响应均匀性------------------------------------------------------------------------ -->
		<div id="table3">
			<div class="innertitle">
				3.响应均匀性
				（ <el-checkbox
					style="margin-right: 0"
					v-model="form3.notObtain"
				>无法获取预处理影像</el-checkbox>）
			</div>
			<!-- （ <el-checkbox @change="changeNotHave($event, 3)" v-model="form3.notHave" style="margin-right: 0">设备不具备预处理影像程序</el-checkbox>） -->

			<div class="tip-30">
				<span>管电压：<el-input v-model="form3.tubeVoltage" class="input-line"/>kV</span>/<el-input v-model="form3.tubeCurrent" class="input-line"/>mAs</span>
				滤线栅：
				<el-radio-group v-model="form3.takeOutFilterGrid" class="split-radio">
					<el-radio :label="1">取下</el-radio>
					<el-radio :label="2">无法取下</el-radio>
					<el-radio :label="0">无</el-radio>
				</el-radio-group>;
				<span>附加滤过:1mmCu</span>
			</div>

			<table border="1" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td width="10%">测量位置</td>
					<td width="10%">中心</td>
					<td width="15%">左上</td>
					<td width="15%">右上</td>
					<td width="15%">左下</td>
					<td width="15%">右下</td>
					<td width="15%">平均值</td>
					<td colspan="2" width="15%">均匀性（%）</td>
				</tr>

				<tr>
					<td>实测平均像素值（PV）</td>
					<td>
						<el-input v-model="form3.pixelValue_1"/>
					</td>
					<td>
						<el-input v-model="form3.pixelValue_2"/>
					</td>
					<td>
						<el-input v-model="form3.pixelValue_3"/>
					</td>
					<td>
						<el-input v-model="form3.pixelValue_4"/>
					</td>
					<td>
						<el-input v-model="form3.pixelValue_5"/>
					</td>
					<td class="result">
						{{ form3.averagePixelValue }}
					</td>
					<td rowspan="2" class="result">
						{{ form3.cv }}
					</td>
				</tr>
				<tr>
					<td>线性换算剂量D（μGy）</td>
					<td class="result">
						{{ form3.doseValue_1 }}
					</td>
					<td class="result">
						{{ form3.doseValue_2 }}
					</td>
					<td class="result">
						{{ form3.doseValue_3 }}
					</td>
					<td class="result">
						{{ form3.doseValue_4 }}
					</td>
					<td class="result">
						{{ form3.doseValue_5 }}
					</td>
					<td class="result">
						{{ form3.averageDoseValue }}
					</td>
				</tr>
			</table>

			<div class="tip-50">
				<i>$CV = \frac {1}{\overline D} \sqrt(\frac {1}{5 - 1}) \sum\limits_{i=1}\limits^{5} (D_i - \overline D)^ 2 \times 100 \% $</i>
			</div>
		</div>

		<!-- 4.测距误差------------------------------------------------------------------------ -->
		<div id="table4">
			<div class="innertitle">
				4.测距误差
				（ <el-checkbox
					style="margin-right: 0"
					v-model="form4.notObtain"
				>无法获取预处理影像</el-checkbox>）
			</div>
			<div class="tip-30">
				<span>管电压：<el-input v-model="form4.tubeVoltage" class="input-line"/>kV</span>/<el-input v-model="form4.tubeCurrent" class="input-line"/>mAs</span>
				滤线栅：
				<el-radio-group v-model="form4.takeOutFilterGridNot" class="split-radio">
					<el-radio :label="true">有</el-radio>
					<el-radio :label="false">无</el-radio>
				</el-radio-group>;
				<span>附加滤过:无</span>
			</div>

			<table border="1" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td>测量方向</td>
					<td>测量距离<i>$D_m$</i>,mm</td>
					<td>真实距离<i>$D_o$</i>,mm</td>
					<td>床片距<i>$D_b$</i>,cm</td>
					<td>修正值<i>$D_o$</i>,mm</td>
					<td>偏差E，%</td>
				</tr>
				<tr>
					<td>水平</td>
					<td><el-input v-model="form4.testLengthLevel"/></td>
					<td><el-input v-model="form4.readLengthLevel"/></td>
					<td><el-input v-model="form4.bedSpacingLevel"/></td>
					<td class="result">{{ form4.correctValueLevel }}</td>
					<td class="result">{{ form4.deviationLevel }}</td>
				</tr>
				<tr>
					<td>垂直</td>
					<td><el-input v-model="form4.testLengthVertical"/></td>
					<td><el-input v-model="form4.readLengthVertical"/></td>
					<td><el-input v-model="form4.bedSpacingVertical"/></td>
					<td class="result">{{ form4.correctValueVertical }}</td>
					<td class="result">{{ form4.deviationVertical }}</td>
				</tr>
			</table>
			<div class="tip-50">
				<!-- 修正长度 <i>$ Dm = (SID - h)× D / SID \quad \qquad $</i>
				偏差 <i>$( \% ) = [ (Dm - Do) / Do ] × 100 \% $</i>  -->
				<span><i>$ D_{o修正} = \frac {D_o \times SID}{SID - D_b} $</i></span>
				<span style="margin-left: 50px">偏差 <i>$ \frac {D_m - D_{o修正}}{D_{o修正}} \times 100 \% $</i></span>
			</div>
		</div>

		<!-- 5.残影------------------------------------------------------------------------ -->
		<div id="table5">
			<div class="innertitle">
				5.残影（ <el-checkbox v-model="form5.testState">状态检测无此项</el-checkbox>）
			</div>

			<div class="tip-30">
				滤线栅：
				<el-radio-group v-model="form5.takeOutFilterGrid" class="split-radio">
					<el-radio :label="1">取下</el-radio>
					<el-radio :label="2">无法取下</el-radio>
					<el-radio :label="0">无</el-radio>
				</el-radio-group>
			</div>

			<table border="1" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td colspan="3" width="32%">预置曝光条件</td>
					<td width="10%">Pb板残影</td>
					<td width="10%">残影区PV</td>
					<td width="10%">非残影区PV</td>
					<td width="5%">偏差,%</td>
				</tr>
				<tr>
					<td>第1次曝光</td>
					<td>
						<el-input v-model="form5.lowestKv_1" class="input-line"/>kV/
						<el-input v-model="form5.tubeCurrent_1" class="input-line"/>mAs(最小条件)
					</td>
					<td>
						2mm铅板滤过
					</td>
					<td rowspan="3">
						<el-radio-group v-model="form5.pbAfterimage" class="split-radio">
							<el-radio :label="true">有</el-radio>
							<el-radio :label="false">无</el-radio>
						</el-radio-group>
					</td>
					<td rowspan="3">
						<el-input v-model="form5.pvAfterimage"/>
					</td>
					<td rowspan="3">
						<el-input v-model="form5.notPvAfterimage"/>
					</td>
					<td rowspan="3" class="result">
						{{ form5.errorValue }}
					</td>
				</tr>
				<tr>
					<td>第2次曝光</td>
					<td>
						<el-input v-model="form5.lowestKv_2" class="input-line"/>kV/
						<el-input v-model="form5.tubeCurrent_2" class="input-line"/>mAs(约5μGy)
					</td>
					<td>
						1mm铅板滤过
					</td>
				</tr>
				<tr>
					<td>第3次曝光</td>
					<td>
						<el-input v-model="form5.lowestKv_3" class="input-line"/>kV/
						<el-input v-model="form5.tubeCurrent_3" class="input-line"/>mAs(约1μGy)
					</td>
					<td>
						1mm铅板滤过
					</td>
				</tr>
			</table>

			<!-- <div class="tip-50">
				误差（%）=（1 - 残影区平均像素值 ÷ 非残影区平均像素值）× 100%；校准值 = 测量值 × 校准因子
			</div> -->
			<div class="tip-50">
				偏差：<i>$PV_残影偏差 = \frac {PV_残影区 - PV_非残影区}{PV_非残影区} \times 100 \%$</i>
			</div>
		</div>

		<!-- 6.伪影------------------------------------------------------------------------ -->
		<div id="table8">
			<div class="innertitle">
				6.伪影
				（ <el-checkbox
					style="margin-right: 0"
					v-model="form8.notObtain"
				>无法获取预处理影像</el-checkbox>）
			</div>
			<!-- （ <el-checkbox @change="changeNotHave($event, 8)" v-model="form8.notHave" style="margin-right: 0">设备不具备预处理影像程序</el-checkbox>） -->
			<div class="tip-30">
				<span>预置条件：<el-input v-model="form8.tubeVoltage" class="input-line"/>kV</span>/<el-input v-model="form8.tubeCurrent" class="input-line"/>mAs</span>
				滤线栅：
				<el-radio-group v-model="form8.takeOutFilterGridNot" class="split-radio">
					<el-radio :label="true">有</el-radio>
					<el-radio :label="false">无</el-radio>
				</el-radio-group>;
				<span style="margin-left: 8px;">附加滤过:无</span>
			</div>
			<table border="1" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td width="75%">目视检查图像有无伪影</td>
					<td>伪影来源</td>
				</tr>
				<tr>
					<td>
						<el-radio-group v-model="form8.artifacts">
							<el-radio :label="true" class="margin">有</el-radio>
							<el-radio :label="false" class="">无</el-radio>
						</el-radio-group>
					</td>
					<td>
						<el-radio-group v-model="form8.type">
							<el-radio :label="0" class=" margin">伪影来自影像探测器</el-radio>
							<el-radio :label="1" class="">伪影来自监视器</el-radio>
						</el-radio-group>
					</td>
				</tr>
			</table>
		</div>

		<!-- 7.高对比度分辨率------------------------------------------------------------------------ -->
		<div id="table6">
			<div class="innertitle">
				7.高对比度分辨力
			</div>
			<div class="tip-30">
				<span>预置条件：<el-input v-model="form6.tubeVoltage" class="input-line"/>kV</span>/<el-input v-model="form6.tubeCurrent" class="input-line"/>mAs</span>
				滤线栅：
				<el-radio-group v-model="form6.takeOutFilterGrid" class="split-radio">
					<el-radio :label="1">取下</el-radio>
					<el-radio :label="2">无法取下</el-radio>
					<el-radio :label="0">无</el-radio>
				</el-radio-group>;
				<span style="margin-left: 8px;">附加滤过:无;</span>
				<el-checkbox style="margin-left: 8px;" v-model="form6.baseLineDefinition" :disabled="!form6.baseLineControls">建立基线值;</el-checkbox>
        <span v-show="form6.baseLineDefinition">
          建立原因:<el-input class="input-line" style="width: 200px !important;" v-model="form6.baseLineReason" data-cusValidate="text"/>
        </span>
			</div>
			<table border="1" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td>分辨力卡方向</td>
					<td>最大可分辨的线对数目，lp/mm</td>
					<td>厂家规定值<br/>lp/mm</td>
					<td>相对值<br/>%</td>
					<td><i>$f_{Nyquist}$</i><br/>lp/mm</td>
					<td>相对值<br/>%</td>
					<td>基线值<br/>lp/mm</td>
					<td>相对值<br/>%</td>
				</tr>
				<tr>
					<td>
						45°
					</td>
					<td>
						<el-input v-model="form6.contrastResolutionHigh"/>
					</td>
					<td>
						<el-input v-model="form6.manufacturerGuaranteeValue"/>
					</td>
					<td class="result">
						<el-input v-model="form6.factoryRelativeValues" disabled/>
					</td>
					<td>
						<el-input v-model="form6.fnyquist"/>
					</td>
					<td class="result">
						<el-input v-model="form6.fnyquistRelativeValues" disabled/>
					</td>
					<td :class="{result: !form6.baseLineControls}" width="120px" @click="handleDbClickBaselineValue(form6.baselineValue)">
						<span class="text-underline" v-show="!form6.baseLineControls">{{ form6.baselineValue }}</span>
						<el-input v-model="form6.baselineValue" v-show="form6.baseLineControls"/>
					</td>
					<td class="result">
						<el-input v-model="form6.baselineRelativeValues" disabled/>
					</td>
				</tr>
			</table>

			<!-- <div class="tip-50">
				计算结果（%）=高对比度分辨率 ÷ 厂家保证值或 <i>$(f_{Nyquist} \times 1.4)$</i> 或基线值 × 100%；<i>$f_{Nyquist} = 1 / (2a) $</i>
			</div> -->
		</div>

		<!-- 8.低对比度细节检测------------------------------------------------------------------------ -->
		<div id="table7">
			<div class="innertitle">
				8.低对比度细节检测

				<div
          style="float: right; font-size: 15px; color: #2A72EE; cursor: pointer; text-decoration: underline;"
          @click="showLowContrastTestCardDialog= true"
        >
          <i class="el-icon-view"></i><span>查看低对比度测试卡</span>
        </div>
			</div>
			<div class="tip-30">
				<span>预置条件：<el-input v-model="form7.tubeVoltage" class="input-line"/>kV</span>/<el-input v-model="form7.tubeCurrent" class="input-line"/>mAs</span>
				滤线栅：
				<el-radio-group v-model="form7.takeOutFilterGridNot" class="split-radio">
					<el-radio :label="true">有</el-radio>
					<el-radio :label="false">无</el-radio>
				</el-radio-group>;
				<span style="margin-left: 8px;">附加滤过: 1mmCu
					<!-- <el-radio-group v-model="form7.filter" class="split-radio">
						<el-radio :label="0">无</el-radio>
						<el-radio :label="1">1mmCu</el-radio>
					</el-radio-group> -->
				</span>;
				<el-checkbox style="margin-left: 8px;" v-model="form7.baseLineDefinition" :disabled="!form7.baseLineControls">建立基线值;</el-checkbox>
        <span v-show="form7.baseLineDefinition">
          建立原因:<el-input class="input-line" style="width: 200px !important;" v-model="form7.baseLineReason" data-cusValidate="text"/>
        </span>
			</div>
			<table border="1" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td width="10%">预置曝光条件</td>
					<td width="20%">可探测到最小细节</td>
					<td width="13%">基线值</td>
					<td width="10%">细节变化</td>
				</tr>
				<tr>
					<td>
						约5μGy
					</td>
					<td>
						直径：<el-input v-model="form7.diameter" class="input-line" />mm、
						影像细节：<el-input v-model="form7.detailCount" class="input-line" />个；
						对比度：<el-input v-model="form7.contrastRatio" class="input-line" />%
					</td>
					<td :class="{result: !form7.baseLineControls}" @click="handleDbClickBaselineCount(form7.baselineCount)">
						<span v-show="!form7.baseLineControls">
							影像细节：<span class="text-underline">{{ form7.baselineCount }}</span>个；
						</span>
						<span v-show="form7.baseLineControls">
							影像细节：<el-input v-model="form7.baselineCount" class="input-line"/>个；
						</span>
						对比度：<el-input v-model="form7.baselineRatio" class="input-line" />%
					</td>
					<td class="result">
						{{ form7.variation }}
					</td>
				</tr>
			</table>

			<div class="tip-50">
				剂量校准值=剂量测量值 × 校准因子，剂量校准值通过距离平方反比修正到影像接收器入射表面
			</div>
		</div>

		<div id="table9">
			<div class="innertitle">
				其他说明：
			</div>
			<div class="tip-30">
				<el-input
					type="textarea"
					placeholder=""
					v-model="basicForm.specialCircumstances"
					:autosize="{minRows:2}"
					@blur="$bus.$emit('update-basicinfo', basicForm.taskDetectionEquipmentResultId)"
				></el-input>
			</div>
		</div>

		<!-- DDI基线 -->
		<el-dialog
			:title="`探测器剂量指示（DDI） （创建时间：${form1Detail.baseLineDefinitionDate}）`"
			:visible.sync="dialogVisibleDDIBaseLine"
			width="1240px"
			:destroy-on-close="true"
			v-dialogDrag="true"
			append-to-body
		>
			<!-- 1.探测器剂量指示（DDI）------------------------------------------------------------------------ -->
			<div style="padding: 0 20px; width: 100%;">
				<div class="tip-30">
					<span>预置条件：<el-input v-model="form1Detail.tubeVoltage" disabled class="input-line"/>kV/<el-input v-model="form1Detail.tubeCurrent" disabled class="input-line"/>mAs</span>
					滤线栅：
					<el-radio-group v-model="form1Detail.takeOutFilterGrid" disabled class="split-radio">
						<el-radio :label="1">取下</el-radio>
						<el-radio :label="2">无法取下</el-radio>
						<el-radio :label="0">无</el-radio>
					</el-radio-group>;
					<span>附加滤过:1mmCu;</span>
					<el-checkbox style="margin-left: 8px;" v-model="form1Detail.baseLineDefinition" disabled>建立基线值;</el-checkbox>
				</div>

				<table border="1" cellspacing="0" cellpadding="0" align="center" style="width: 100%;">
					<tr>
						<td rowspan="4">剂量指示</td>
						<td rowspan="2" width="200px">
							<el-checkbox v-model="form1Detail.ddi" disabled style="margin-right: 0">该机生产厂家未提供DDI计算公式</el-checkbox><br/>
							({{ form1Detail.ddiValue }})
						</td>
						<td colspan="12">
							<i>$DDI_测量$</i>
						</td>
						<td>参考剂量,μGy</td>
						<td><i>$DDI_参考$</i></td>
						<td><i>$DDI_基线$</i></td>
						<td><i>$DDI_偏差$</i>，%</td>
					</tr>

					<tr>
						<td colspan="3" style="width: 60px;">{{ form1Detail.ddiValue_1 }}</td>
						<td colspan="3" style="width: 60px;">{{ form1Detail.ddiValue_2 }}</td>
						<td colspan="3" style="width: 60px;">{{ form1Detail.ddiValue_3 }}</td>
						<td colspan="3" width="10%" class="result">Avg：{{ form1Detail.ddiValueAvg }}</td>
						<td>{{ form1Detail.referenceDose }}</td>
						<td>{{ form1Detail.referenceDDI }}</td>
						<td class="result">{{ form1Detail.baselineDDI }}</td>
						<td class="result">{{ form1Detail.deviationDDI }}</td>
					</tr>

					<tr>
						<td rowspan="2" width="200px">
							<el-checkbox v-model="form1Detail.pixel" disabled style="margin-right: 0">平均像素值</el-checkbox><br/>
						</td>
						<td colspan="13">
							实测平均像素值，<i>$PV_测量$</i>
						</td>
						<td colspan="2">
							<i>$PV_基线$</i>
						</td>
						<td><i>$DDI_偏差$</i>，%</td>
					</tr>
					<tr>
						<td colspan="4">{{ form1Detail.readoutValue_1 }}</td>
						<td colspan="4">{{ form1Detail.readoutValue_2 }}</td>
						<td colspan="4">{{ form1Detail.readoutValue_3 }}</td>
						<td class="result">Avg：{{ form1Detail.averageReadoutValue }}</td>
						<td colspan="2">{{ form1Detail.baselineValue }}</td>
						<td class="result">{{ form1Detail.deviation }}</td>
					</tr>
				</table>
			</div>
			<div slot="footer">
				<el-button @click="dialogVisibleDDIBaseLine = false">关 闭</el-button>
			</div>
		</el-dialog>

		<!-- 高对比度分辨力基线值 -->
		<el-dialog
			:title="`高对比度分辨力（创建时间：${form6Detail.baseLineDefinitionDate}）`"
			:visible.sync="dialogVisibleBaselineValue"
			width="1240px"
			:destroy-on-close="true"
			v-dialogDrag="true"
			append-to-body
		>
			<!-- 7.高对比度分辨率------------------------------------------------------------------------ -->
			<div style="padding: 0 20px; width: 100%;">
				<div class="tip-30">
					<span>预置条件：<el-input v-model="form6Detail.tubeVoltage" disabled class="input-line"/>kV</span>/<el-input v-model="form6Detail.tubeCurrent" disabled class="input-line"/>mAs</span>
					滤线栅：
					<el-radio-group v-model="form6Detail.takeOutFilterGrid" disabled class="split-radio">
						<el-radio :label="1">取下</el-radio>
						<el-radio :label="2">无法取下</el-radio>
						<el-radio :label="0">无</el-radio>
					</el-radio-group>;
					<span style="margin-left: 8px;">附加滤过:无;</span>
					<el-checkbox style="margin-left: 8px;" v-model="form6Detail.baseLineDefinition" disabled>建立基线值;</el-checkbox>
				</div>
				<table border="1" cellspacing="0" cellpadding="0" align="center" style="width: 100%;">
					<tr>
						<td>分辨力卡方向</td>
						<td>最大可分辨的线对数目，lp/mm</td>
						<td>厂家规定值<br/>lp/mm</td>
						<td>相对值<br/>%</td>
						<td><i>$f_{Nyquist}$</i><br/>lp/mm</td>
						<td>相对值<br/>%</td>
						<td>基线值<br/>lp/mm</td>
						<td>相对值<br/>%</td>
					</tr>
					<tr>
						<td>
							45°
						</td>
						<td>
							{{ form6Detail.contrastResolutionHigh }}
						</td>
						<td>
							{{ form6Detail.manufacturerGuaranteeValue }}
						</td>
						<td>
							{{ form6Detail.factoryRelativeValues }}
						</td>
						<td>
							{{ form6Detail.fnyquist }}
						</td>
						<td>
							{{ form6Detail.fnyquistRelativeValues }}
						</td>
						<td class="result">
							<span>{{ form6Detail.baselineValue }}</span>
						</td>
						<td>
							{{ form6Detail.baselineRelativeValues }}
						</td>
					</tr>
				</table>
			</div>
			<div slot="footer">
				<el-button @click="dialogVisibleBaselineValue = false">关 闭</el-button>
			</div>
		</el-dialog>

		<!-- 低对比度细节检测基线值 -->
		<el-dialog
			:title="`低对比度细节检测（创建时间：${form7Detail.baseLineDefinitionDate}）`"
			:visible.sync="dialogVisibleBaselineCount"
			width="1240px"
			:destroy-on-close="true"
			v-dialogDrag="true"
			append-to-body
		>
			<!-- 8.低对比度细节检测------------------------------------------------------------------------ -->
			<div style="padding: 0 20px; width: 100%;">
				<div class="tip-30">
					<span>预置条件：<el-input v-model="form7Detail.tubeVoltage" disabled class="input-line"/>kV</span>/<el-input v-model="form7Detail.tubeCurrent" disabled class="input-line"/>mAs</span>
					滤线栅：
					<el-radio-group v-model="form7Detail.takeOutFilterGridNot" disabled class="split-radio">
						<el-radio :label="true">有</el-radio>
						<el-radio :label="false">无</el-radio>
					</el-radio-group>;
					<span style="margin-left: 8px;">附加滤过:
						<el-radio-group v-model="form7Detail.filter" disabled class="split-radio">
							<el-radio :label="0">无</el-radio>
							<el-radio :label="1">1mmCu</el-radio>
						</el-radio-group>
					</span>;
					<el-checkbox style="margin-left: 8px;" v-model="form7Detail.baseLineDefinition" disabled>建立基线值;</el-checkbox>
				</div>
				<table border="1" cellspacing="0" cellpadding="0" align="center" style="width: 100%;">
					<tr>
						<td width="10%">预置曝光条件</td>
						<td width="10%">可探测到最小细节</td>
						<td width="10%">基线值</td>
						<td width="10%">细节变化</td>
					</tr>
					<tr>
						<td>
							约5μGy
						</td>
						<td>
							影像细节：{{ form7Detail.detailCount }}个
						</td>
						<td class="result">
							<span>影像细节：{{ form7Detail.baselineCount }}个</span>
						</td>
						<td class="result">
							{{ form7Detail.variation }}
						</td>
					</tr>
				</table>
			</div>
			<div slot="footer">
				<el-button @click="dialogVisibleBaselineCount = false">关 闭</el-button>
			</div>
		</el-dialog>

		<LowContrastTestCardDialog
      :show.sync="showLowContrastTestCardDialog"
    ></LowContrastTestCardDialog>
  </div>
</template>

<script>
import { getInfoById, saveInfo06, doseIndication, signal, responseUniformity, rangeError, addDetector,
ghost, resolutionHigh, resolutionLow, artifact, getBaseLineDDIDetail, getBaselineValueDetail, getBaselineCountDetail} from "@/api/testItem/item06";
import Template from "@/views/basicData/template";
import LowContrastTestCardDialog from '@/views/slide/component/LowContrastTestCardDialog.vue'

export default {
  name: "testItem06",
  components: {Template, LowContrastTestCardDialog},
  data() {
    return {
			itemIndex: 0,

			checked: [],
			form: {

			},
			// 表单-1.管电压指示的偏离
			form1: {

			},
			// 表单-2.曝光时间指示的偏离
			form2: {

			},
			// 表单-3.有用线束半值层
			form3: {

			},
			// 表单-4.输出量重复性
			form4: {

			},
			// 表单-5.输出量线性
			form5: {

			},
			// 表单-6.有用线束垂直度偏离、光野与照射野四边的偏离
			form6: {

			},
			// 表单-7.AEC重复性
			form7: {

			},
			// 表单-8.AEC响应
			form8: {

			},
			// 表单-9.AEC电离室之间一致性
			form9: {

			},
			itemsId: null,
			dialogVisibleDDIBaseLine: false,
			dialogVisibleBaselineValue: false,
			dialogVisibleBaselineCount: false,

			form1Detail: {},
			form6Detail: {},
			form7Detail: {},

			showLowContrastTestCardDialog: false
    };
  },
	computed: {
		formula(value) {

		}
	},
  props: {
		// 基本信息数据
    basicForm: {
			type: Object,
      default: () => {
				return {}
			},
    },
		//
    tabList: {
      type: Array,
      default: () => ([])
    },
		// 当前激活的tab
		activeNameEquipment: {
			type: String,
			default: ''
		},
  },
  created() {
		this.$nextTick(()=>{
			// 获取详情
			if (this.activeNameEquipment.indexOf(':') > -1) {
				this.itemIndex = this.activeNameEquipment.split(':')[0].split('-')[1]
			}
			getInfoById(this.basicForm.resultId, this.itemIndex).then(response => {
				this.itemsId =  response.data?.itemsId;
				this.form = {
					sidType: response.data?.sidType,
					notHave: response.data?.notHave,
					sid: response.data?.sid,
					sdd: response.data?.sdd,
					positionName: response.data?.positionName,
					computeType: 0, //  计算方式 0线性拟合 1对数拟合
				};
				if (this.form.sidType == 1) {
					this.$set(this.form, "cus_formsid", this.form.sid);
				}
				if (this.form.sidType == 0) {
					this.$set(this.form, "cus_formsid", "");
				}
				// this.$set(this.form, "cus_formsid", Number(this.form.sid) == 180 ? "" : this.form.sid);
				// 1.探测器剂量指示（DDI）
				this.form1 =  response.data?.detectorDoseIndication || {};
				// 2.信号传递特性（STP）
				this.form2 =  response.data?.signalTransferCharacteristic || {};
				// 3.响应均匀性
				this.form3 =  response.data?.responseUniformity || {};
				// 4.测距误差
				this.form4 =  response.data?.rangeError || {};
				// 5.残影
				this.form5 =  response.data?.ghost || {};
				// 6.高对比度分辨率
				this.form6 =  response.data?.contrastResolutionHigh || {};
				// 7.低对比度细节检测
				this.form7 =  response.data?.contrastResolutionLow || {};
				// 8.伪影
				this.form8 =  response.data?.artifact || {};
				if(this.form8.sid) {
					this.$set(this.form8, "cus_sid", this.form8.sid == "180" ? "180" : "other");
				}
			}).catch((response) => {
				this.$emit("loadingchange", true);
			});
			let _this = this;
			// 绑定请求---统一信息
			let formInputs = [];
			let arr = document.getElementsByClassName("forminput");
			for (let i = 0; i < arr.length; i++) {
				formInputs.push(...arr[i].getElementsByTagName("input"));
			}
			for (let i = 0; i < formInputs.length; i++) {
				this.bind(formInputs[i], () => {
					this.submitTestForm("form");
				})
			}

			// 绑定请求---表格
			let itemsLength = 8;
			for (let index = 0; index < itemsLength; index++) {
				let tableInputs = document.getElementById(`table${index + 1}`).getElementsByTagName("input");
				for (let i = 0; i < tableInputs.length; i++) {
					this.bind(tableInputs[i], () => {
						this.submitTestForm(index + 1);
					})
				}
			}
		})
  },
  methods: {
		// 提交检测项信息
		submitTestForm(index) {
			this.$nextTick(() => {
				console.log("提交检测项06", index);
				this.$emit("loadingchange", true);
				if (index == "form") {
					this.form.itemsId = this.itemsId;
				} else {
					this[`form${index}`].itemsId = this.itemsId;
				}
				switch (index) {
					// 1.探测器剂量指示（DDI）
					case 1:
						this.form1.index = Number(this.itemIndex)
						doseIndication(this.form1).then((response) => {
							response.data ? this.form1 = response.data : "";
							this.$emit("loadingchange", false);
							this.resetInfo()
						})
						break;
					// 2.信号传递特性（STP）
					case 2:
						signal(this.form2).then((response) => {
							response.data ? this.form2 = response.data : "";
							this.$emit("loadingchange", false);
							this.resetInfo()
						})
						break;
					case 3:
						// 3.响应均匀性
						responseUniformity(this.form3).then((response) => {
							response.data ? this.form3 = response.data : "";
							this.$emit("loadingchange", false);
							this.resetInfo()
						})
						break;
					case 4:
						// 4.测距误差
						rangeError(this.form4).then((response) => {
							response.data ? this.form4 = response.data : "";
							this.$emit("loadingchange", false);
							this.resetInfo()
						})
						break;
					case 5:
						// 5.残影
						ghost(this.form5).then((response) => {
							response.data ? this.form5 = response.data : "";
							this.$emit("loadingchange", false);
							this.resetInfo()
						})
						break;
					case 6:
						// 6.高对比度分辨率
						this.form6.index = Number(this.itemIndex)
						resolutionHigh(this.form6).then((response) => {
							response.data ? this.form6 = response.data : "";
							this.$emit("loadingchange", false);
							this.resetInfo()
						})
						break;
					case 7:
						// 7.低对比度细节检测
						this.form7.index = Number(this.itemIndex)
						resolutionLow(this.form7).then((response) => {
							response.data ? this.form7 = response.data : "";
							this.$emit("loadingchange", false);
							this.resetInfo()
						})
						break;
					case 8:
						// 8.伪影
						// this.form8.tubeVoltage = "60";
						// this.form8.tubeCurrent = "10";
						// this.form8.cus_sid == "180" ? this.form8.sid = "180" : "";
						// let cus_sid = this.form8.cus_sid;
						// artifact(this.form8).then((response) => {
						// 	response.data ? this.form8 = response.data : "";
						// 	if (this.form8.sid == "180") {
						// 		this.$set(this.form8, "cus_sid", "180")
						// 	} else if(cus_sid == "other") {
						// 		this.$set(this.form8, "cus_sid", "other")
						// 	}
						// 	// this.$set(this.form8, "cus_sid", this.form8.sid == "180" ? "180" : "other")
						// 	this.$emit("loadingchange", false);
						// })
						artifact(this.form8).then((response) => {
							response.data ? this.form8 = response.data : "";
							this.$emit("loadingchange", false);
							this.resetInfo()
						})
						break;
					case "form":
						// 其余信息
						// this.form.sid = this.form.sidType == "0" ? "180" : this.form.cus_formsid;
						saveInfo06(this.form).then((response) => {
							this.$emit("loadingchange", false);
							this.resetInfo()
						})
						break;
				}
			})
		},
		resetInfo() {
			getInfoById(this.basicForm.resultId, this.itemIndex).then(response => {
				this.itemsId =  response.data?.itemsId;
				this.form = {
					...this.form,
					sidType: response.data?.sidType,
					notHave: response.data?.notHave,
					sid: response.data?.sid,
					sdd: response.data?.sdd,
					positionName: response.data?.positionName,
				};
				// 1.探测器剂量指示（DDI）
				this.form1 =  response.data?.detectorDoseIndication || {};
				// 2.信号传递特性（STP）
				this.form2 =  response.data?.signalTransferCharacteristic || {};
				// 3.响应均匀性
				this.form3 =  response.data?.responseUniformity || {};
				// 4.测距误差
				this.form4 =  response.data?.rangeError || {};
				// 5.残影
				this.form5 =  response.data?.ghost || {};
				// 6.高对比度分辨率
				this.form6 =  response.data?.contrastResolutionHigh || {};
				// 7.低对比度细节检测
				this.form7 =  response.data?.contrastResolutionLow || {};
				// 8.伪影
				this.form8 =  response.data?.artifact || {};
			})
		},
		// 更改电压
		changetube(val, index) {
			if (index == "2-8") {
				if (val == "other" || !val) {
					this.$set(this.form8, "sid", "");
				}
			}
			if (index == "2-1") {
				this.$set(this.form, "cus_formsid", "");
				if(val == "0") {
					this.$set(this.form, "sid", "180");
				}
				if(val == "1") {
					this.$set(this.form, "sid", this.form.cus_formsid);
				}
				if(!val) {
					this.$set(this.form, "sid", "");
				}
			}
		},
		// 更改无此设备
		changeNotHave(val, index) {
			let list = [1, 2, 3, 5, 8];
			list.forEach(item => {
				if(item != index) {
					this.$set(this[`form${item}`], "notHave", val);
					if(item != 3) {
						this.submitTestForm(item);
					}
				}
			});
		},
		// 更改配置
		changeComputeType(val) {
			this.$set(this.form2, "computeType", val);
			console.log(val);
		},
		// 点击 DDI_基线
		handleDbClickBaselineDDI(value) {
			if (this.form1.baseLineControls) return
			if (!value && value !== 0) return
			this.dialogVisibleDDIBaseLine = true
			getBaseLineDDIDetail(this.itemsId, this.itemIndex).then((response) => {
				this.form1Detail = response.data || {}
				this.$nextTick(() => {
					window.MathJax.Hub.Typeset();
				})
			}).catch((err) => {})
		},
		// 点击 高对比度分辨力 基线值
		handleDbClickBaselineValue(value) {
			if (this.form6.baseLineControls) return
			if (!value && value !== 0) return
			this.dialogVisibleBaselineValue = true
			getBaselineValueDetail(this.itemsId, this.itemIndex).then((response) => {
				this.form6Detail = response.data || {}
				this.$nextTick(() => {
					window.MathJax.Hub.Typeset();
				})
			}).catch((err) => {})
		},
		// 点击 低对比度细节检测 基线值
		handleDbClickBaselineCount(value) {
			if (this.form7.baseLineControls) return
			if (!value && value !== 0) return
			this.dialogVisibleBaselineCount = true
			getBaselineCountDetail(this.itemsId, this.itemIndex).then((response) => {
				this.form7Detail = response.data || {}
				this.$nextTick(() => {
					window.MathJax.Hub.Typeset();
				})
			}).catch((err) => {})
		},
		// 点击增加探测器
		handleAddTestItem06() {
			addDetector(this.basicForm.resultId).then(res => {
				this.$bus.$emit('add-testItem', '06')
			}).catch(err => {})
		}
  },
};
</script>

<style lang="scss" scoped>
@import '../content.scss';
</style>
